using System;
using System.Collections.Generic;
using System.Text;
using System.Xml;
using MIS.EN.WebDav;

namespace MIS.EN.Exchange.Parsers
{
    internal class EnumInt32WebDavResultValueParser : IWebDavResultValueParser
    {
        #region IWebDavResultValueParser Members

        public object ParseValue(XmlNode responseNode, WebDavXmlHelper webDavXmlHelper,
            string namespacePrefix, string propertyName, string type)
        {
            return webDavXmlHelper.GetEnumInt32PropertyValueFromResponseNode(responseNode, namespacePrefix, propertyName, type);
        }

        public string GetFormattedValue(object propertyValue)
        {
            return ((int)propertyValue).ToString();
        }

        public string GetFormattedValueForSearch(object propertyValue)
        {
            return this.GetFormattedValue(propertyValue);
        }

        #endregion
    }
}